package com.example.acceledemo;

import java.io.Serializable;
import java.util.LinkedList;
import java.util.List;


@SuppressWarnings("serial")
public class AcceleRoute implements Serializable {

	List<Node> nodeList;
		
	public AcceleRoute() {
        nodeList = new LinkedList<Node>();
	}
	
	public void addNode(Node node)
	{
		nodeList.add(node);
	}
	
	public void addNodes(List<Node> list)
	{
		nodeList.addAll(list);
	}
	
	@Override
	public String toString() {
		
		StringBuffer buffer = new StringBuffer();
		
		for(int i=0; i<nodeList.size(); i++)
		{
			float[] xyz=nodeList.get(i).getXyz();
			long time=nodeList.get(i).getTime();
			buffer.append(xyz[0] + ";" + xyz[1] + ";" + xyz[2] + ";");
			buffer.append(time + "\n");	
		}
		buffer.deleteCharAt(buffer.length()-1);
		return buffer.toString();
	}	
	
}
